package order;

import com.alibaba.nacos.common.utils.ThreadUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.sleuth.autoconfig.SleuthAnnotationConfiguration;
import org.springframework.cloud.sleuth.autoconfig.zipkin2.ZipkinAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author ZackYoung
 * @version 1.0
 * @date 2021/12/9
 */
@SpringBootApplication(exclude ={ZipkinAutoConfiguration.class})
@RestController
@EnableFeignClients
@EnableDiscoveryClient
public class SkywalkingProductApplication {
    public static void main(String[] args) {
        SpringApplication.run(SkywalkingProductApplication.class, args);
    }

    @Resource
    FeignDemo feignDemo;

    @RequestMapping("/product")
    public String hello() {
        ThreadUtils.sleep(2000);
        return "I am product\n" + feignDemo.hello();
    }
}
